// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   nseer_dbs.java

package include.nseer_db;

import java.sql.*;

public class nseer_dbs
{

	private Connection connection;
	private Statement statement;
	private String source;
	private String url1;
	private String url2;

	public nseer_dbs()
	{
	}

	public boolean conn(String source, String protocol, String drivername, String user, String password)
	{
		String url = (new StringBuilder("jdbc:")).append(protocol).append(":").append(source).toString();
		try
		{
			Class.forName(drivername);
		}
		catch (ClassNotFoundException e)
		{
			e.printStackTrace();
			return false;
		}
		try
		{
			connection = DriverManager.getConnection(url, user, password);
			statement = connection.createStatement();
		}
		catch (SQLException e)
		{
			e.printStackTrace();
			return false;
		}
		return true;
	}

	public void executeUpdate(String sqlCommand)
	{
		try
		{
			statement.executeUpdate(sqlCommand);
		}
		catch (SQLException e)
		{
			e.printStackTrace();
		}
	}

	public ResultSet executeQuery(String sqlCommand)
	{
		ResultSet resultset = null;
		try
		{
			resultset = statement.executeQuery(sqlCommand);
		}
		catch (SQLException e)
		{
			e.printStackTrace();
		}
		return resultset;
	}

	public void close()
	{
		try
		{
			statement.close();
			connection.close();
		}
		catch (SQLException e)
		{
			e.printStackTrace();
		}
	}
}
